package homework_04.home_09;

public class HomeWork_09 {
    /* 给定一维数组{ -10，2，3，246，-100，0，5} ，计算出数组中的平均值、最大值、最小值。 */
    public static void main(String[] args) {
        int []a = {-10,2,3,246,-100,0,5};
        qiuzhi(a);
    }
    public static void qiuzhi(int[]a){
        int max=a[0];
        int min=a[0];
        int sum=0;
        for (int i=0;i<a.length;i++){
            if (max<a[i]){
                max=a[i];
            }else if (min>a[i]){
                min=a[i];
            }
            sum+=a[i];
        }
        System.out.println("max:"+max);
        System.out.println("min:"+min);
        System.out.println("avg:"+sum/a.length);
    }
}
